Universal Plug and Play (UPnP) is a system
that allows devices to be remotely controlled across a network.
DarkNet does not currently support Universal
Plug and Play in its entirety; it only has support for NAT traversal.
Using UPnP NAT traversal you can programmatically setup port forwarding
entries for your router.
UPnP is fairly unreliable and is prone to failure. This is not due to any fault in DarkNet, but due to the nature of UPnP. UPnP can fail for one of the following reasons:
UPnP NAT errors can also occur in the following situations. The extent to which you experience such NAT errors depends on the router; some routers will let errors fail silently whilst others will complain at every stage possible:
It is recommended that you disable error
message boxes (mnToggleErrorMode) and check for errors silently using
one of the other error modes. When an error occurs you can assume one
of the above is the cause and abort attempts to use UPnP. You can then
provide an alternative to UPnP such as instructing the user to manually
setup port forwarding or NAT punch-through.
UPnP commands involve communication with the router which often takes several seconds to complete; for this reason most UPnP commands can be used in a non blocking (a synchronous) way so that other operations can be performed whilst the UPnP action completes. When using a command a synchronously mnPollUPNP should be used to determine when the action has completed.
1: mnAddPortMap